package com.luych.toolbox.common.feign.param.docker.service;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

@ApiModel("容器数据参数")
public class DockerContainerParam {

    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("镜像")
    private String image;
    @ApiModelProperty("CPU配置")
    private Long cpu;
    @ApiModelProperty("内存配置")
    private Long memory;
    @ApiModelProperty("主机名")
    private String hostname;
    @ApiModelProperty("重启策略")
    private String restartPolicy;
    @ApiModelProperty("特权模式")
    private Boolean privileged;
    @ApiModelProperty("网络")
    private String network;
    @ApiModelProperty("IP地址")
    private String ipAddress;
    @ApiModelProperty("mac地址")
    private String macAddress;
    @ApiModelProperty("端口")
    private List<Port> ports;
    @ApiModelProperty("DNS")
    private List<String> dns;
    @ApiModelProperty("HOSTS")
    private List<Hosts> hosts;
    @ApiModelProperty("挂载")
    private List<Volume> volumes;
    @ApiModelProperty("环境变量")
    private List<Env> envs;
    @ApiModelProperty("标签")
    private List<Label> labels;
    @ApiModelProperty("ARG")
    private String arg;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Long getCpu() {
        return cpu;
    }

    public void setCpu(Long cpu) {
        this.cpu = cpu;
    }

    public Long getMemory() {
        return memory;
    }

    public void setMemory(Long memory) {
        this.memory = memory;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public String getRestartPolicy() {
        return restartPolicy;
    }

    public void setRestartPolicy(String restartPolicy) {
        this.restartPolicy = restartPolicy;
    }

    public Boolean getPrivileged() {
        return privileged;
    }

    public void setPrivileged(Boolean privileged) {
        this.privileged = privileged;
    }

    public String getNetwork() {
        return network;
    }

    public void setNetwork(String network) {
        this.network = network;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getMacAddress() {
        return macAddress;
    }

    public void setMacAddress(String macAddress) {
        this.macAddress = macAddress;
    }

    public List<Port> getPorts() {
        return ports;
    }

    public void setPorts(List<Port> ports) {
        this.ports = ports;
    }

    public List<String> getDns() {
        return dns;
    }

    public void setDns(List<String> dns) {
        this.dns = dns;
    }

    public List<Hosts> getHosts() {
        return hosts;
    }

    public void setHosts(List<Hosts> hosts) {
        this.hosts = hosts;
    }

    public List<Volume> getVolumes() {
        return volumes;
    }

    public void setVolumes(List<Volume> volumes) {
        this.volumes = volumes;
    }

    public List<Env> getEnvs() {
        return envs;
    }

    public void setEnvs(List<Env> envs) {
        this.envs = envs;
    }

    public List<Label> getLabels() {
        return labels;
    }

    public void setLabels(List<Label> labels) {
        this.labels = labels;
    }

    public String getArg() {
        return arg;
    }

    public void setArg(String arg) {
        this.arg = arg;
    }

    @ApiModel("容器端口参数")
    public static class Port {

        @ApiModelProperty("宿主机IP")
        private String hostIp;
        @ApiModelProperty("宿主机端口")
        private Long hostPort;
        @ApiModelProperty("容器端口")
        private String containerPort;

        public String getHostIp() {
            return hostIp;
        }

        public void setHostIp(String hostIp) {
            this.hostIp = hostIp;
        }

        public Long getHostPort() {
            return hostPort;
        }

        public void setHostPort(Long hostPort) {
            this.hostPort = hostPort;
        }

        public String getContainerPort() {
            return containerPort;
        }

        public void setContainerPort(String containerPort) {
            this.containerPort = containerPort;
        }
    }

    @ApiModel("容器存储参数")
    public static class Volume {

        @ApiModelProperty("源")
        private String source;
        @ApiModelProperty("目标")
        private String destination;
        @ApiModelProperty("模式")
        private String mode;

        public String getSource() {
            return source;
        }

        public void setSource(String source) {
            this.source = source;
        }

        public String getDestination() {
            return destination;
        }

        public void setDestination(String destination) {
            this.destination = destination;
        }

        public String getMode() {
            return mode;
        }

        public void setMode(String mode) {
            this.mode = mode;
        }
    }

    @ApiModel("容器HOSTS参数")
    public static class Hosts {

        @ApiModelProperty("域名")
        private String url;
        @ApiModelProperty("IP")
        private String ip;

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getIp() {
            return ip;
        }

        public void setIp(String ip) {
            this.ip = ip;
        }
    }

    @ApiModel("容器环境变量参数")
    public static class Env {

        @ApiModelProperty("KEY")
        private String key;
        @ApiModelProperty("VALUE")
        private String value;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    @ApiModel("容器标签参数")
    public static class Label {

        @ApiModelProperty("KEY")
        private String key;
        @ApiModelProperty("VALUE")
        private String value;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
}
